<template>
  <div id="app">
    <van-overlay :show="loading">
      <div class="loading">
        <van-loading color="#1989fa" />
      </div>
    </van-overlay>
    <router-view />
  </div>
</template>


<script>
  export default {
    name: 'App',
    components: {
    },
    data() {
      return {
        loading: false
      }
    },
    computed: {
    },
    watch: {
    },
    created() {
      this.init()
    },
    methods: {
      init() {
        this.$bus.$on('loading-show', () => {
          this.loading = true
        });
        this.$bus.$on('loading-hide', () => {
          this.loading = false
        });
      }
    }
  }
</script>

<style lang="scss">
  .loading{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
</style>
